/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面不会缓存
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 * }
 */
import out from './out';

export default [
  {
    path: '/login',
    name: '_login',
    redirect: '/login',
    meta: {
      icon: 'el-icon-s-home',
      title: '登陆',
    },
    component: () => import(/* webpackChunkName: "login" */ '@/views/Layout.vue'),
    children: [
      {
        path: '/login',
        name: 'login',
        component: () => import(/* webpackChunkName: "login" */ '@/views/Login.vue'),
      },
    ],
  },
  {
    path: '/',
    name: '_home',
    redirect: '/home',
    meta: {
      icon: 'el-icon-s-home',
      title: '首页',
    },
    component: () => import(/* webpackChunkName: "login" */ '@/views/Layout.vue'),
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import(/* webpackChunkName: "login" */ '@/views/Login.vue'),
      },
    ],
  },
  {
    path: '/putInStorage',
    name: 'putInStorage',
    meta: {
      icon: 'el-icon-receiving',
      title: '入库',
      // access: ['ROLE_USER_Falsh'],
      // access: ['ROLE_USER'],
    },
    component: () => import(/* webpackChunkName: "putInStorage" */ '@/views/Layout.vue'),
    children: [
      {
        path: 'purchaseOrder',
        name: 'purchaseOrder',
        meta: {
          title: '采购订单',
        },
        component: () => import(/* webpackChunkName: "putInStorage" */ '@/views/putInStorage/purchaseOrder.vue'),
      },
      {
        path: 'ladingOrder',
        name: 'ladingOrder',
        meta: {
          title: '销售退货提单',
        },
        component: () => import(/* webpackChunkName: "putInStorage" */ '@/views/putInStorage/ladingOrder.vue'),
      },
      {
        path: 'stockInOrder',
        name: 'stockInOrder',
        redirect: 'stockInOrder',
        meta: {
          title: '入库单',
        },
        // component: () => import(/* webpackChunkName: "putInStorage" */ '@/views/putInStorage/stockInOrder.vue'),
        component: {
          template: '<router-view/>',
        },
        children: [
          {
            path: '/',
            name: '_stockInOrder',
            meta: {
              title: '入库单',
            },
            component: () => import(/* webpackChunkName: "stockInOrder" */ '@/views/putInStorage/stockInOrder.vue'),
          },
          {
            path: 'generalStockInOrderBack',
            name: 'generalStockInOrderBack',
            meta: {
              title: '领料退回',
            },
            component: () => import(/* webpackChunkName: "stockInOrder" */ '@/views/putInStorage/generalStockInOrderBack.vue'),
          },
          {
            path: 'generalStockInOrder',
            name: 'generalStockInOrder',
            meta: {
              title: '入库收货',
            },
            component: () => import(/* webpackChunkName: "stockInOrder" */ '@/views/putInStorage/generalStockInOrder.vue'),
          },
          {
            path: 'generalStockInOrderCheck',
            name: 'generalStockInOrderCheck',
            meta: {
              title: '入库验收',
            },
            component: () => import(/* webpackChunkName: "stockInOrder" */ '@/views/putInStorage/generalStockInOrderCheck.vue'),
          },
          {
            path: 'generalStockInOrderPutaway',
            name: 'generalStockInOrderPutaway',
            meta: {
              title: '入库上架',
            },
            component: () => import(/* webpackChunkName: "stockInOrder" */ '@/views/putInStorage/generalStockInOrderPutaway.vue'),
          },
        ],
      },

      // {
      //   path: 'stockInOrder2',
      //   name: 'stockInOrder2',
      //   meta: {
      //     title: '入库单2',
      //     hideInMenu: true,
      //   },
      //   component: () => import(/* webpackChunkName: "login" */ '@/views/putInStorage/stockInOrder.vue'),
      // },
    ],
  },
  ...out,
];
